<?php
# +----------------------------------------------------------------------
# | lhp配置
# +----------------------------------------------------------------------

return [

    // +----------------------------------------------------------------------
    // | 权限过滤 相关设置
    // +----------------------------------------------------------------------
    'auth' => [
        // token过滤
        'token_filter' => [
            'settings/info',
            'login/login',
            'login/captcha',
        ],
        // 权限过滤
        'permission_filter' => [
            'settings/info',
            'login/login',
            'login/captcha',
        ],
    ],

    // +----------------------------------------------------------------------
    // | 密码加盐相关设置
    // +----------------------------------------------------------------------
    'passport' => [
        'password_salt' => 'doimetp3qwz6dbnpuu12v5fe845l17gk',
    ],

    // +----------------------------------------------------------------------
    // | token相关设置
    // +----------------------------------------------------------------------
    'token' => [
        'id' => 'lhpadmin', //token的唯一标识
        'issuer' => 'admin-api.lhp.com', //签发人
        'audience' => '', //接收人 魔术方法 __construct 动态设置
        'sign' => '3f8e4b5c9a7d1e3f5g6h7i8j9k0l1m2n3o4p5q6r7s8t9u0v1w2x3y4z5', //签名密钥
        'expire' => 3600 * 24 //有效期  86400
    ],

    // +----------------------------------------------------------------------
    // | 表单上传相关设置
    // +----------------------------------------------------------------------
    'upload' => [

        // +----------------------------------------------------------------------
        // | 图片上传相关设置
        // +----------------------------------------------------------------------
        'image' => [
            'frame_image' => '/default_image.png',
            //图片上传配置
            'image_upload' => "/admin/upload/image",
            // 对应Amis的maxSize（单位：KB）
            'max_size' => 2048, // 2MB
            // 对应Amis的accept（允许的文件后缀，多个用逗号分隔）
            'allowed_exts' => 'jpg,jpeg,png,gif,webp',
            // 允许的MIME类型（与Amis的accept对应，更严格的验证）
            'allowed_mimes' => [
                'image/jpeg',
                'image/png',
                'image/gif',
                'image/webp'
            ],
            // 图片尺寸限制（Amis的imageWidth/imageHeight对应）
            'image_dimension' => [
                'max_width' => 2000, // 最大宽度
                'max_height' => 2000, // 最大高度
                'min_width' => 100, // 最小宽度（可选）
                'min_height' => 100 // 最小高度（可选）
            ]
        ],

        // +----------------------------------------------------------------------
        // | 文件上传相关设置
        // +----------------------------------------------------------------------
        'file' => [
            'max_size_use_chunk' => 10240,
            // 对应Amis的maxSize（单位：KB）
            'max_size' => 20480, // 10MB
            // 对应Amis的accept（允许的文件后缀）
            'allowed_exts' => 'pdf,doc,docx,xls,xlsx,zip,rar',
            // 允许的MIME类型
            'allowed_mimes' => [
                'application/pdf',
                'application/msword',
                'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
                'application/vnd.ms-excel',
                'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
                'application/zip',
                'application/x-rar-compressed'
            ],
            //文件上传配置
            'file_upload' => "/admin/upload/file",
            //文件分片上传配置
            "start_chunk_api" => "/admin/upload/file_upload_chunk_start",
            "chunk_api" => "/admin/upload/file_upload_chunk",
            "finish_chunk_api" => "/admin/upload/file_upload_chunk_finish",
            "chunk_size" => 1024 * 1024 * 2,
            "concurrency" => 3,
        ]
    ]
];
